package com.qzsoft.zhjd.materiel.modules.materielhome.dto;

import java.math.BigDecimal;
import java.util.List;

import lombok.Data;

/**
 * @ClassName MaterielReceiveSendChartDto
 * @Description 收发料图表信息
 * @author linhuawei
 * @since 2022-04-25
 */
@Data
public class MaterielReceiveSendChartDto {

    /**
     * 过磅重量
     */
    private BigDecimal total;

    /**
     * 数据列表
     */
    private List<MaterielReceiveSendChartListDto> list;

    public void countTotal() {
        total = BigDecimal.ZERO;
        if (null != list) {
            for (MaterielReceiveSendChartListDto dto : list) {
                if (null != dto.getValue()) {
                    total = total.add(dto.getValue());
                }
            }
        }
    }

}
